import { world } from "@minecraft/server";

export class DebugLog {
  public static enable: boolean = true;

  public static log(message: string) {
    if (this.enable) world.sendMessage(`[DEBUG]${message}`);
  }
}

export class Logger {
  constructor(private readonly loggerName: string) {}
  debug(mes: string) {
    console.debug(`[${this.loggerName}]${mes}`);
  }

  log(mes: string) {
    console.log(`[${this.loggerName}]${mes}`);
  }

  error(mes: string) {
    console.error(`[${this.loggerName}]${mes}`);
  }

  warn(mes: string) {
    console.warn(`[${this.loggerName}]${mes}`);
  }
}
